<?php

namespace Addons\Wukong;

use Common\Controller\Addon;

class WukongAddon extends Addon
{
    public $info = array(
        'name' => 'Wukong',
        'title' => '阿里悟空即时聊天IM',
        'description' => '使用阿里悟空作为底层技术实现的即时聊天功能',
        'status' => 1,
        'author' => '駿濤',
        'version' => '1.0.0'
    );

    public function install()
    {
        $this->initHook('tool', '返回顶部，右下角工具栏', 1);
        return true;
    }

    public function uninstall()
    {
        return true;
    }


    public function tool()
    {

        $mid = is_login();
        if ($mid) {
            $model = D('Addons://Wukong/WukongAuth');
            $wuUser = $model->getLoginModel($mid, 'web');
            $this->assign('signature', json_encode($wuUser));
        }

       /* $friend_ids = D('Follow')->getMyFriends();
        $this->assign('friend_ids', implode(',',$friend_ids));*/

        $this->display('display');
    }


}